<?php
$tdataports=array();
	$tdataports[".NumberOfChars"]=80; 
	$tdataports[".ShortName"]="ports";
	$tdataports[".OwnerID"]="";
	$tdataports[".OriginalTable"]="ports";


	
//	field labels
$fieldLabelsports = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsports["English"]=array();
	$fieldToolTipsports["English"]=array();
	$fieldLabelsports["English"]["id"] = "Id";
	$fieldToolTipsports["English"]["id"] = "";
	$fieldLabelsports["English"]["port_name"] = "Port Name";
	$fieldToolTipsports["English"]["port_name"] = "";
	$fieldLabelsports["English"]["city_id"] = "City";
	$fieldToolTipsports["English"]["city_id"] = "";
	if (count($fieldToolTipsports["English"])){
		$tdataports[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Hong Kong S.A.R.)")
{
	$fieldLabelsports["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldToolTipsports["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldLabelsports["Chinese (Hong Kong S.A.R.)"]["id"] = "Id";
	$fieldToolTipsports["Chinese (Hong Kong S.A.R.)"]["id"] = "";
	$fieldLabelsports["Chinese (Hong Kong S.A.R.)"]["port_name"] = "Port Name";
	$fieldToolTipsports["Chinese (Hong Kong S.A.R.)"]["port_name"] = "";
	$fieldLabelsports["Chinese (Hong Kong S.A.R.)"]["city_id"] = "City Id";
	$fieldToolTipsports["Chinese (Hong Kong S.A.R.)"]["city_id"] = "";
	if (count($fieldToolTipsports["Chinese (Hong Kong S.A.R.)"])){
		$tdataports[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Taiwan)")
{
	$fieldLabelsports["Chinese (Taiwan)"]=array();
	$fieldToolTipsports["Chinese (Taiwan)"]=array();
	$fieldLabelsports["Chinese (Taiwan)"]["id"] = "Id";
	$fieldToolTipsports["Chinese (Taiwan)"]["id"] = "";
	$fieldLabelsports["Chinese (Taiwan)"]["port_name"] = "Port Name";
	$fieldToolTipsports["Chinese (Taiwan)"]["port_name"] = "";
	$fieldLabelsports["Chinese (Taiwan)"]["city_id"] = "City Id";
	$fieldToolTipsports["Chinese (Taiwan)"]["city_id"] = "";
	if (count($fieldToolTipsports["Chinese (Taiwan)"])){
		$tdataports[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="French")
{
	$fieldLabelsports["French"]=array();
	$fieldToolTipsports["French"]=array();
	$fieldLabelsports["French"]["id"] = "Id";
	$fieldToolTipsports["French"]["id"] = "";
	$fieldLabelsports["French"]["port_name"] = "Port Name";
	$fieldToolTipsports["French"]["port_name"] = "";
	$fieldLabelsports["French"]["city_id"] = "City Id";
	$fieldToolTipsports["French"]["city_id"] = "";
	if (count($fieldToolTipsports["French"])){
		$tdataports[".isUseToolTips"]=true;
	}
}


	
	$tdataports[".NCSearch"]=true;

	

$tdataports[".shortTableName"] = "ports";
$tdataports[".nSecOptions"] = 0;
$tdataports[".recsPerRowList"] = 1;	
$tdataports[".tableGroupBy"] = "0";
$tdataports[".mainTableOwnerID"] = "";
$tdataports[".moveNext"] = 1;




$tdataports[".showAddInPopup"] = false;

$tdataports[".showEditInPopup"] = false;

$tdataports[".showViewInPopup"] = false;


$tdataports[".fieldsForRegister"] = array();

$tdataports[".listAjax"] = true;

	$tdataports[".audit"] = false;

	$tdataports[".locking"] = false;
	
$tdataports[".listIcons"] = true;
$tdataports[".edit"] = true;
$tdataports[".inlineEdit"] = true;
$tdataports[".view"] = true;

$tdataports[".exportTo"] = true;

$tdataports[".printFriendly"] = true;

$tdataports[".delete"] = true;

$tdataports[".showSimpleSearchOptions"] = true;

$tdataports[".showSearchPanel"] = true;


$tdataports[".isUseAjaxSuggest"] = true;

$tdataports[".rowHighlite"] = true;


// button handlers file names

$tdataports[".addPageEvents"] = false;

$tdataports[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdataports[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdataports[".isUseTimeForSearch"] = false;

$tdataports[".isUseiBox"] = false;



$tdataports[".isUseInlineAdd"] = true;

$tdataports[".isUseInlineEdit"] = true;
$tdataports[".isUseInlineJs"] = $tdataports[".isUseInlineAdd"] || $tdataports[".isUseInlineEdit"];

$tdataports[".allSearchFields"] = array();

$tdataports[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdataports[".allSearchFields"]))
{
	$tdataports[".allSearchFields"][] = "id";	
}
$tdataports[".globSearchFields"][] = "port_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_name", $tdataports[".allSearchFields"]))
{
	$tdataports[".allSearchFields"][] = "port_name";	
}
$tdataports[".globSearchFields"][] = "city_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_id", $tdataports[".allSearchFields"]))
{
	$tdataports[".allSearchFields"][] = "city_id";	
}


$tdataports[".googleLikeFields"][] = "id";
$tdataports[".googleLikeFields"][] = "port_name";
$tdataports[".googleLikeFields"][] = "city_id";



$tdataports[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdataports[".allSearchFields"])) 
{
	$tdataports[".allSearchFields"][] = "id";	
}
$tdataports[".advSearchFields"][] = "port_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_name", $tdataports[".allSearchFields"])) 
{
	$tdataports[".allSearchFields"][] = "port_name";	
}
$tdataports[".advSearchFields"][] = "city_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_id", $tdataports[".allSearchFields"])) 
{
	$tdataports[".allSearchFields"][] = "city_id";	
}

$tdataports[".isTableType"] = "list";


	

$tdataports[".isDisplayLoading"] = true;

$tdataports[".isResizeColumns"] = false;





$tdataports[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdataports[".strOrderBy"] = $gstrOrderBy;
	
$tdataports[".orderindexes"] = array();

$tdataports[".sqlHead"] = "SELECT id,   port_name,   city_id";
$tdataports[".sqlFrom"] = "FROM ports";
$tdataports[".sqlWhereExpr"] = "";
$tdataports[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdataports[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdataports[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdataports[".Keys"] = $tableKeys;

//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "ports";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataports["id"]=$fdata;
//	port_name
	$fdata = array();
	$fdata["strName"] = "port_name";
	$fdata["ownerTable"] = "ports";
		$fdata["Label"]="Port Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "port_name";
	
		$fdata["FullName"]= "port_name";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=50";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataports["port_name"]=$fdata;
//	city_id
	$fdata = array();
	$fdata["strName"] = "city_id";
	$fdata["ownerTable"] = "ports";
		$fdata["Label"]="City"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="city_name";
				$fdata["LookupTable"]="cities";
	$fdata["LookupOrderBy"]="city_name";
																$fdata["AllowToAdd"]=true; 
				
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_id";
	
		$fdata["FullName"]= "city_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataports["city_id"]=$fdata;

	
$tables_data["ports"]=&$tdataports;
$field_labels["ports"] = &$fieldLabelsports;
$fieldToolTips["ports"] = &$fieldToolTipsports;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["ports"] = array();

	
// tables which are master tables for current table (detail)
$masterTablesData["ports"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto511=array();
$proto511["m_strHead"] = "SELECT";
$proto511["m_strFieldList"] = "id,   port_name,   city_id";
$proto511["m_strFrom"] = "FROM ports";
$proto511["m_strWhere"] = "";
$proto511["m_strOrderBy"] = "";
$proto511["m_strTail"] = "";
$proto512=array();
$proto512["m_sql"] = "";
$proto512["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto512["m_column"]=$obj;
$proto512["m_contained"] = array();
$proto512["m_strCase"] = "";
$proto512["m_havingmode"] = "0";
$proto512["m_inBrackets"] = "0";
$proto512["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto512);

$proto511["m_where"] = $obj;
$proto514=array();
$proto514["m_sql"] = "";
$proto514["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto514["m_column"]=$obj;
$proto514["m_contained"] = array();
$proto514["m_strCase"] = "";
$proto514["m_havingmode"] = "0";
$proto514["m_inBrackets"] = "0";
$proto514["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto514);

$proto511["m_having"] = $obj;
$proto511["m_fieldlist"] = array();
						$proto516=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "ports"
));

$proto516["m_expr"]=$obj;
$proto516["m_alias"] = "";
$obj = new SQLFieldListItem($proto516);

$proto511["m_fieldlist"][]=$obj;
						$proto518=array();
			$obj = new SQLField(array(
	"m_strName" => "port_name",
	"m_strTable" => "ports"
));

$proto518["m_expr"]=$obj;
$proto518["m_alias"] = "";
$obj = new SQLFieldListItem($proto518);

$proto511["m_fieldlist"][]=$obj;
						$proto520=array();
			$obj = new SQLField(array(
	"m_strName" => "city_id",
	"m_strTable" => "ports"
));

$proto520["m_expr"]=$obj;
$proto520["m_alias"] = "";
$obj = new SQLFieldListItem($proto520);

$proto511["m_fieldlist"][]=$obj;
$proto511["m_fromlist"] = array();
												$proto522=array();
$proto522["m_link"] = "SQLL_MAIN";
			$proto523=array();
$proto523["m_strName"] = "ports";
$proto523["m_columns"] = array();
$proto523["m_columns"][] = "id";
$proto523["m_columns"][] = "port_name";
$proto523["m_columns"][] = "city_id";
$obj = new SQLTable($proto523);

$proto522["m_table"] = $obj;
$proto522["m_alias"] = "";
$proto524=array();
$proto524["m_sql"] = "";
$proto524["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto524["m_column"]=$obj;
$proto524["m_contained"] = array();
$proto524["m_strCase"] = "";
$proto524["m_havingmode"] = "0";
$proto524["m_inBrackets"] = "0";
$proto524["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto524);

$proto522["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto522);

$proto511["m_fromlist"][]=$obj;
$proto511["m_groupby"] = array();
$proto511["m_orderby"] = array();
$obj = new SQLQuery($proto511);

$queryData_ports = $obj;
$tdataports[".sqlquery"] = $queryData_ports;

$tableEvents["ports"] = new eventsBase;

?>
